<?php
    if($_POST["memID"]){
        $memID=$_POST["memID"];
        $member=  getMember($memID);
    }
?>
<table style="margin-left: auto;margin-right: auto;">
    <tr>
        <td>
             <?php
                if(is_file("memberPhoto/".$row["yourImage"])){
                    $imgFile="memberPhoto/".$row["yourImage"];
                }else{
                    $imgFile="images/member.png";
                }
            ?>
            <img src="<?=$imgFile?>" style="max-height: 50px;">
        </td>
        <td><?=$member["firstName"]." ".$member["lastName"]?></td>
    </tr>
</table><br>
<table style="width: 100%;">
    <?php
        $query="
            select  *
            from    cost_general
            ";
        $result=  mysql_query($query) or die(mysql_error());
        $numrows=  $result->num_rows;
        $i=0;
        $costCount=0;
        while($i<$numrows){
            $row=  $result->fetch_array(MYSQLI_ASSOC);
            if($row["mat"]=="true"){
                $costCount++;
            }
            
            if($row["wage"]=="true"){
                $costCount++;
            }
            ?>
    <tr>
        <td colspan="2"><?=$row["cgName"]?></td>
    </tr>
    <tr>
        <td style="padding-bottom: 10px">
            <div class="input-group">
                <span class="input-group-addon" style="width: 70px;">ค่าแรง</span>
                <input type="tel" name="wage[]" class="form-control">
                <span class="input-group-addon">บาท</span>
            </div>
        </td>
    </tr>
                <?php
            $costCount=0;
            $i++;
        }
    ?>
</table>
<input type="submit" value="ต่อไป > " class="btn btn-default" style="float: right;"
       onclick="window.open('.?page=costPhase&phaseID=1','_self')"
       >
